Near-real time encoding of linear signal

ABSTRACT

A near-real time encoding of a signal comprising at least a video signal is disclosed. The encoding comprises acquiring the video signal included in a linear stream, the linear stream comprising at least two contents without a logical distinction between them, dividing the video signal into at least a first segment and a second segment of respective preset durations, at least one of the segments being capable of containing at least a part of said two contents and comprising recomposing information, executing a first encoding of said first segment using an off-line encoding to obtain a first encoded segment, executing a second encoding of said second segment using an off-line encoding to obtain a second encoded segment, said second encoding being executed at least partially in parallel with the first encoding, recomposing, using said recomposing information, said first and second encoded segments to obtain a continuous encoded signal.

RELATED APPLICATIONS

This application is a U.S. National Phase Application under 35 U.S.C.371 of International Application No. PCT/IB2014/000709 filed May 12,2014, which was published on Nov. 20, 2014, under InternationalPublication Number WO 2014/184632 A1, which claims the benefit ofItalian Patent Application No. MI2013A000785 filed on May 13, 2013.These applications are incorporated herein by reference in theirentirety.

The present invention relates to the encoding of linear signals, inparticular near-real time encoding of a video signal included in alinear stream.

BACKGROUND OF THE INVENTION

At present, the transmission of channels and contents in the broadcastmode (satellite, cable, terrestrial) is based on the concept of having aplayout system which sequentially emits, via a playlist, a series ofchannels and/or contents. The channels can be sent in SDI (SerialDigital Interface) format or through IP (Internet Protocol) streams overan Ethernet network toward a system of real-time compression, which istypically composed of one or more encoders (for example complying withMPEG2, MPEG4, AVC, H.264 standards) which perform the compression eitherin a CBR mode (Constant Bit Rate, i.e. parameters and a fixed bit rateare assigned to the components audio, video and channel data) or VBR(Variable Bit Rate). In particular, the VBR process exploits, frame byframe, a statistic to give more bandwidth to the channel (of a group ofchannels) which has contents requiring more bandwidth in order to have agood quality as compared to other channels in the same frame requiringless bandwidth; in this manner, for example, it is possible to maintainthe total bandwidth (for example of a transponder and/or a digitalterrestrial Mux) of the different channels of the group fixed.

To date, the management of compression, though optimized by the VBRprocess, has been based on real-time compression with a latency, i.e.the time difference between the instant at which a frame enters theencoder and the instant at which it is output compressed, which variesfrom a few milliseconds to a few seconds (for example two seconds).

The encoder thus has only a few available frames to analyze; thecompression routines therefore cannot perform accurate analyses of thevideo, which determines a limit to their ability to reduce (compress)the video stream in terms of the ratio between quality and size of thedata flow (bit rate or bandwidth) compared to what can be obtained withencoders that work off-line (for example encoders for VOD, Video OnDemand) and which thus have the possibility of analyzing the entirevideo.

Therefore, the known types of encoding currently applied to linearstreams of content require a high transmission bandwidth for the reasonsset forth above.

SUMMARY OF THE INVENTION

The present invention has the object of remedying the problems tied tothe known techniques for encoding linear streams.

A first aspect of the invention envisages a method for near-real-timeencoding of a signal comprising at least a video signal, the methodcomprising the steps of:

-   -   acquiring the video signal included in a linear stream, wherein        the linear stream comprises at least two contents without a        logical distinction between them;    -   dividing the video signal into at least a first and second        segment of respective preset durations, at least one of the two        segments being capable of containing at least a part of the two        contents and comprising recomposing information;    -   executing a first encoding of the first segment using an        off-line encoding to obtain a first encoded segment;    -   executing a second encoding of the second segment using an        off-line encoding to obtain a second encoded segment, wherein        the second encoding is executed at least partially in parallel        with the first encoding;    -   recomposing, using the recomposing information, the first        encoded segment and the second encoded segment to obtain a        continuous encoded signal.

A second aspect of the invention envisages an entity for near-real-timeencoding of a signal comprising at least a video signal, the devicecomprising:

-   -   acquiring means for acquiring the video signal included in a        linear stream, the linear stream comprising at least two        contents without a logical distinction between them;    -   dividing means for dividing the video signal into at least a        first segment and a second segment of preset duration, at least        one of the segments being capable of containing at least a part        of the two contents and comprising recomposing information;    -   first encoding means for executing a first encoding of the first        segment using an off-line encoding to obtain a first encoded        segment;    -   second encoding means for executing a second encoding of the        second segment using an off-line encoding to obtain a second        encoded segment, said second encoding being executed at least        partially in parallel with the first encoding;    -   recomposing means for recomposing, using said recomposing        information, the first and second encoded segment to obtain a        continuous encoded signal.

A third aspect of the invention envisages a method for treating a signalto be processed with near-real-time encoding, said signal comprising atleast a video signal, said method comprising the steps of:

-   -   acquiring the video signal included in a linear stream, said        linear stream comprising at least two contents without a logical        distinction between them;    -   dividing the video signal into at least a first segment and        second segment each having respective preset duration, each of        the segments being capable of containing at least a part of said        two contents without logical distinction and comprising        recomposing information.

A fourth aspect of the invention envisages a program for a computerconfigured to execute, when said program is run on a computer, all ofthe steps according to any of the methods envisaged by theabove-described aspects.

LIST OF FIGURES

FIG. 1 illustrates a flow diagram of a method for near real-timeencoding of signals according to a first embodiment;

FIG. 2 illustrates a block diagram of an entity for near real-timeencoding of signals according to a second embodiment;

FIG. 3 illustrates a flow diagram of a method for treating a signal tobe processed with near-real-time encoding according to a thirdembodiment;

FIG. 4 illustrates a block diagram of an entity for treating a signal tobe processed with near-real-time encoding according to a fourthembodiment;

FIG. 5 illustrates an example for near real-time encoding of signals.

DETAILED DESCRIPTION

The inventors, on the basis of their considerations and analyses of theknown techniques for encoding linear channels, have observed that onepossibility for improving the ratio between quality and bit rate is touse an off-line compression process. Off-line compression is in factparticularly efficient: the quality of the output being equal, it cancompress 40% more content than a real-time compression. However, itrequires a long and accurate process, because the entire content mayhave to be processed several times; in order to maintain a high level ofquality, moreover, the encoded signal must be analyzed to detectimperfections in the compression process; the imperfections detected canthus be removed and/or corrected. This accurate process can require 2-3times the duration of an individual content. It should however be notedthat off-line compression processes individual contents and notcontinuous streams of contents, i.e. contents that have a beginning andan end. The product of the compression, even when placed in sequence,does not lose this individuality. In fact, contents compressed off-line,when joined in sequence, do not have an end that fits perfectly with thebeginning of the subsequent content and to ensure a splice betweencontents it is necessary to insert “black” elements.

This is due to the fact that off-line contents, even when joined insequence, are distinct logical units since they belong to two distinctunits, for example two distinct files or two distinct data flows. Morein particular, in compressed content (whether it be a file or a stream)each frame is distinguished by two “counters”, PTS (PresentationTimeStamp) and DTS (Display TimeStamp). The former numbers thetransmission sequence of the frames, whereas the latter indicates theplaying order. These numbers must be monotonically increasing within thecontent, and the first frame of the content normally has a randomlyselected number. When two contents are concatenated, it is very likelythat the two counters will violate the constraint of monotonic increase.This makes it necessary to initialize the two counters, as well as otherparameters, when starting to process a second content. This renders thereproduction of two separate contents encoded off-line unsuitable forlinear reproduction.

Thanks to the present solution, it is possible to obtain an encodingprocess that can ensure a compression with a greater efficiency than ispresently available on the market, offered by technology providers,while maintaining unchanged the playout, compression and transmissionprocesses, that is, without requiring substantial modifications to thearchitecture of existing solutions.

The inventors have however recognized, among other factors, the problemthat in real-time compression, well known to be applied to the encodingof linear channels, the encoding must be carried out in reasonably fasttimes, which precludes obtaining a particularly high compression factor,since this would require different processing operations on the signaland quality checks that cannot be done in fast times.

On the other hand, in the case of a more accurate compression such asoff-line compression, there is an extremely long delay. In addition,off-line compression is not suitable for compressing linear channels,because it operates on each content as a separate logical unit and isthus not capable of processing a continuous stream in which two or moreitems of content have been joined without logical distinction.

Based on the above considerations and their own recognitions, theinventors propose a system for optimizing the procedures of compressingcontents intended for distribution via broadcasting. In particular, theysuggest exploiting the mechanisms of off-line compression, managing themin a time such as to ensure a configurable, predictable delay, the delaybeing preferably comprised between about ten seconds and a few minutes.This encoding method can be defined as near live or near real-time andwill be illustrated below with reference to the different embodiments,variants thereof and examples.

With reference to FIG. 1, a first embodiment of the invention will beillustrated which relates to a method for near-real-time encoding of asignal comprising at least one video signal. Near real-time encodingmeans an encoding wherein the latency (delay) introduced by the encodingis constant (or also nearly constant, as illustrated further below) andconfigurable, and whose typical values are preferably comprised betweenabout ten seconds and a few minutes (the values are illustrative and notlimiting).

In step S100 the method acquires a video signal included in a linearstream. The linear stream, or also linear channel, comprises at leasttwo contents without a logical distinction between them. Content meansat least one among audio, video and data services corresponding to thosethat may be enjoyed by a user. Subtitles or applications (interactive ornon-interactive) are examples of a data service. Examples of content arefilms, ads, promos, variety shows, etc. Therefore, a linear streamcomprising the acquired video signal includes at least two videoservices (as already said, without a logical distinction between them).The lack of a logical distinction (or continuity) indicates that the twocontents, for example the two video services, are sequential withouttemporal or logical interruptions. As seen earlier in the previousexample, the two contents are characterized by PTS and DTS having acorrect sequence. In the event that an intentional interruption isdesired between two videos representing two television programs, forexample a pause or a break (for example black), the flow will containthat interruption interposed between the two programs and without beinglogically separated from the two units representing the programsthemselves. In this respect, the interruption can be considered like aunit of content (or a video service) placed between the two televisionprograms and logically continuous with the programs themselves withinthe linear stream. The acquisition process of step S100 can be carriedout by means of a specific acquisition board mounted, for example, on aserver, or by the acquiring means 210 with reference to FIG. 2,illustrated further below. The acquired signal can be in any formatknown in the art, for example in SDI, HD-SDI, MPEG-2, MPEG-4, AVC, H.264format, etc. . . . . The acquired signal, if in a MPEG-2, MPEG-4, AVC,H.264 format, etc., can be obtained by applying an encoding, for examplereal-time encoding, on a digital signal (or analog signal, after dueconversion), which can be, for example, available in the SDI or HS-SDIformat.

In a step S200, the video signal is divided into at least a firstsegment and a second segment of respective preset durations (as willbecome more apparent further below, the two segments can have adifferent length due to different variances or tolerances or because thelength is reconfigured). The preset duration can be established once andfor all or modified on a periodic basis either manually, for example viaconfiguration by an operator, or automatically, for example by means ofa supervision device which cyclically changes the duration of thesegment, or on the basis of alarms or signal analysis. Preset durationmeans an established duration or an established duration plus or minusan established variance, as explained further below.

Therefore, it is possible for two consecutive segments into which thelinear stream is divided to have a different duration, both because thepreset duration has been varied in the meanwhile or because it is variedwithin the tolerance corresponding to the established variance.

Each of said segments is capable of containing at least a part of thetwo contents mentioned. This means that each segment (into which thestream is divided) need not necessarily contain part of both contents;however, it must be provided for this to occur when necessary. In thisrespect, a segment into which the linear stream is divided is differentfrom a GOP, since a GOP by definition can contain only a part relatingto one content and not simultaneously parts relating to two contents,the two contents being distinct and relating to two distinct logicalunits. We may consider the example of a news program followed by anadvertising break, in turn followed by a weather report. In the divisionof the stream, many of the segments will contain only a part of one ofthe three units making up the stream, while it will be possible that atleast two segments each comprise a part of two distinct streams (inparticular, a segment will in all likelihood contain part of the newsand part of the advertising; another segment, following the other orremote from it, may contain part of the advertisement and part of theweather report). Though a content, for example the weather report, maybe shorter than the length of a segment, there will also be cases inwhich a segment includes a unit of content in its entirety. It can alsonot be ruled out that a content (for example the news) may end exactlyat the end of a segment. Examples in which the segment has a length of 1or 2 minutes (possibly with the tolerance imposed by the pre-establishedvariance) will be illustrated below; however, the solution describedhere is not limited to such values. In fact, a different segment lengthis also suitable, provided that it is sufficiently greater than thenumber of frames a real-time encoder works on. For example, in the caseof a real-time encoder working on an average of 12 frames, a segmentwill have a length equal to at least three times the number of real-timeframes, preferably at least 5 times, and even more preferably 10 times.In fact, the longer the segment is relative to the number of frames thereal-time encoder is operating on, the larger the advantage derived fromoff-line encoding will be. However, as the length (and the tolerance orvariance thereof) is configurable, it is possible to maintain apredictable, controllable delay.

The segments further comprise composition information to enable thereconstruction of the (encoded) linear stream once the compression ofeach of the segments is completed. It is in fact important to ensurethat the encoded (or output) segments maintain the same sequence as theframes we had prior to segmentation. The composition information, whichhereinafter will also be referred to as IN/OUT information, isrepresented, for example, by a sequential numbering assigned to eachsegment, or by a unique identifier assigned to each segment (theidentifier can be associated, for example, with the relative or absoluteposition of the segment in the stream and/or with the channel thesegment belongs to, or an identifier corresponding to or derived fromone or both the PTS and DTS values mentioned above, etc. . . . ).

In a step S300, the method involves executing a first encoding of thefirst segment using an off-line encoding to obtain a first encodedsegment. The first encoding of the first segment can begin when thewhole segment has been received or when at least a portion of it hasbeen received, the length of the portion depending on the selectedencoding parameters. Optionally and preferably, the encoding begins whena substantial part of the segment is received by the assigned encoder(for example, see above, when at least 5, 7 or 10 times the number offrames of a real-time encoder have been received), in order to be ableto carry out a detailed analysis on a significant number of frames andthereby obtain a higher compression factor as compared to a real-timealgorithm operating on a much more limited number of frames.

Off-line encoding here means encoding without real-time timeconstraints, that is, with predefined, configurable time constraints. Inother words, off-line encoding means an encoding whose parameters areset in such a way as to complete the entire encoding process on asegment within a preset and configurable time interval (at the mostwithin a certain tolerance limit); in one example this interval ispreferably comprised between about ten seconds and a few minutes. Sinceit is possible to analyze a large number of frames, potentially even allframes of the segment, it is possible to obtain a higher compressionfactor than in the case of real-time encoding, without compromisingquality. The presence of two contents within the segment is howevertransparent to the off-line encoding algorithm, since the two contentsare sequential and without any logical distinction. This is adistinguishing feature compared to the common use of off-line encoders:in fact, in the prior art an off-line encoder is applied to a firstcontent and, once the encoding of the latter is completed, to a secondcontent, the joining together of which requires the insertion of anartificial and uncontrollable (or not so easily controllable) and/orunlikely to be configurable pause. In contrast, the segmentation asdescribed above enables the two contents or part of the two contents tobe processed within the same segment in a manner that is transparent tothe off-line encoding algorithm. In other words, the off-line encodingneed not know or worry about the beginning or end of the contents, as itonly has to process each segment as a separate unit.

In a step S400, a second encoding of the second segment is executedusing an off-line encoding to obtain a second encoded segment. Theoff-line encoding used in step S400 can preferably be the same as thatused in the first encoding but is not necessarily the same. In oneexample, the encoding parameters applied to the first segment can be thesame as or different from those applied to the second segment. As willbe illustrated further below, the first and second encoding can becarried out by two distinct hardware units, by the same hardware unitwhose resources are duly partitioned or by any distributed orconcentrated hardware/software combination. It should be noted that thesecond encoding according to step S400 is carried out at least partiallyin parallel with the first encoding of step S300. In other words, thesecond encoding begins when the first encoding has not yet beencompleted. The second encoding can be completed before, simultaneouslywith or after completion of the first encoding. Thanks to the at leastpartially parallel execution, it is easier to ensure that the encodingis carried out within a pre-established, configurable time interval andthus prevent the delay from increasing over time or with the number ofsegments processed. However, it cannot be ruled out that in the case ofvery large hardware/software resources it may be possible to carry outan encoding with a high compression of a first portion of the segment(when, for example, a substantial portion has been received, for exampleat least 5/7/10 times the number of frames of a real-time encoding) andan encoding—possibly with a lower compression—of a second part of thesegment so that the total encoding of the segment is completed at thesame time as or a few frames after the last frame of the segment isreceived. In such a case, the two segments could be processedsequentially so as to have a delay approximately equal to the length ofthe segment (and tolerance or variance if present). Reference is alsomade to the example illustrated further below with reference to FIG. 5.

In step S500, the first encoded segment and the second encoded segmentare recomposed using the recomposing information so as to obtain acontinuous encoded signal. The signal thus obtained can then bebroadcast (for example via satellite, digital terrestrial, internet,mobile radio networks, etc. . . . ), directly or after having beenoptionally further processed according to need.

The off-line encoding is such that the encoding (or the variousnecessary processing operations) of the respective segment is completedin a time which is shorter than or equal to a pre-configured delay. Thepre-configured delay can be set once and for all or can be variedmanually or automatically; the variation can be made at pre-establishedintervals (for example at a certain frequency: every hour, day, or everynumber M of segments) or on the basis of other settings, e.g. alarms orthe quality of the output signal. The pre-configured delay can also beplaced in relation with the length of the segment; for example, it canbe equal, in one example, to the sum of the length of the segment (andmore in particular to the preset duration, expressed in minutes,seconds, or thousands of a second) and a predefined interval (likewiseexpressed in a unit of time). The predefined interval is a quantitygreater than or equal to zero. In particular, when the value is equal tozero, it means that the delay will be equal to the length of the segment(or preset duration) and that the encoding will have to be last when thelast frame of the segment has been received (see further below: in thiscase the compression of the last frames will be very low or absent).When, on the other hand, the predefined interval has a value greaterthan zero, it means that the off-line encoding will have more timeavailable for encoding the whole segment once the last frame of thesegment has been received. In the illustrative example of FIG. 5, theencoding must be completed in a pre-configured time of 4 minutes. Thismeans that once the last frame of the segment has been received, theoff-line encoding will have another two minutes available to completethe encoding. In this way it will be possible to control the overalldelay and prevent it from building up in an unacceptable manner. Theperson skilled in the art recognizes that it is possible to varydifferent factors according to requirements, and in particular: segmentlength, delay and compression parameters (and/or computing power). Forexample, once the desired delay has been fixed, by decreasing the lengthof the segment it is possible to leave more time for off-line encoding,which will thus be able to process the available segments to a greaterdegree and/or carry out the encoding with lower performance HW and/or SWresources.

Analogous reasoning applies in the case in which a longer segment isselected. In a similar manner, by lengthening the delay, it will bepossible increase the length of the segment (thus enabling the off-lineencoding to analyze more segments) and/or give the off-line encodingmore time to analyze the segment frames.

As mentioned above, the aforesaid first and second segments are distinctfrom the groups of frames obtained by means of a known video encodingalgorithm such as MPEG2, MPEG4 or H.264 (wherein the GOP represents anexample of the grouping). In fact, the segment can be obtained, forexample, from an SDI signal which, even if it is compressed, does nothave a structure with groups of frames. It is moreover important toobserve that the segmentation is based on considerations of aconfigurable and predictable delay, whereas the group is determined bythe encoder on the basis of considerations imposed by the encodingparameters. In other words, the choice of the segment length is dictatedby or based on a desired latency, irrespective of evaluations concerningthe encoding. It can therefore be said that a grouping of frames iscarried out on the basis of decisions of the encoding algorithm, whereasthe segmentation is carried out a priori or independently of thecriteria regulating the encoding thereof. If the input signal does notinclude a grouping (for example, in the event that the signal acquiredin step S100 is in a digital but not MPEG format), the preset durationof the segment can be equal to a predetermined time, for example exactlyone minute. In such a case, the input signal, for example in HD-SDIformat, will be exactly broken down into segments of one minute (oneminute is a non-limiting example; other values can be 10 s or less, 2min, 10 min, or even more). If, on the other hand, the input signal is agrouped signal (for example in MPEG2, MPEG4, AVC, H.264 format, etc. . .. ), the preset duration of the segment can (but need not necessarily)be equal to a predetermined time plus or minus a certain pre-establishedvalue that we shall indicate as Δ, and also call pre-establishedvariance. The Δ (delta) value can be selected as equal to the maximumpredictable length of the GOP of the input signal, equal to averageduration (predicted, statistical or based on the flow received thus far)of the GOP of the input signal, or equal to a quantity in turnestablished in advance to enable the segment to be closed exactly at theend of a GOP of the input signal. What we have said will be clarified bymeans of an example: let us suppose that the input signal ischaracterized by a GOP with a variable length but having an averagelength of 0.5 s, and that the length of the segment must be equal toabout 1 minute in order to have a nearly constant delay of about oneminute. Since the length is variable, it cannot be ruled out that at thesixtieth second of the segment in question the GOP of the input signalmay not yet be finished: let us assume that N frames (for example 10frames) still remain in order to close it. Setting the delta at a valueequal to twelve frames (in the example, the average length of the inputGOP) will enable the input signal to be divided at the sixtieth secondplus twelve frames or at the sixtieth second minus twelve frames, orwithin the interval (60 s−Δ, 60 s+Δ). Other examples are possible, inwhich the interval in question is (60 s, 60 s+Δ), (60 s−Δ, 60 s), (60s−Δ1, 60 s+Δ2), with Δ1 and Δ2 greater than or equal to zero. Thisenables the segment to be closed with the closure of the correspondingGOP of the input signal; that is, the last frame of the segmentcoincides with the last frame of a GOP of the input signal. It cantherefore be said that the preset duration corresponds to thecombination of a predetermined time and a pre-established variance(represented in the examples respectively by 60 s and the Δ value). Inother words, the preset duration falls within a time interval determinedby the combination of a predetermined time and a pre-establishedvariance. The following should also be noted. In order to prevent thelatency from increasing excessively over time and with the passing ofsegments, the Δ can be periodically varied. For example, if tenconsecutive segments were all to be segmented for a length equal to oneminute plus twelve frames, the segmentation of the subsequent segmentscan be carried out in advance (thus with a negative delta) for a certainnumber of successive segments until the overall latency falls withincertain limits.

The variation in the delta value can thus be controlled on the basis ofthe overall latency measured at a certain instant (or at sampleinstants) or on the average of the latencies introduced by the last M(with M as great as desired) segments.

According to a first illustrative example, the off-line encodingoptionally enables a single segment, or at least part of it, to beprocessed several times. According to another example, the processedsignal, processed one or more times as in the first example, can beanalyzed to detect imperfections due to the compression process, whichcan thus be optionally removed and/or corrected.

According to an illustrative option, the off-line encoding can include avariation in the length of the group of frames. For example, in the caseof H.264 encoding, the off-line encoding can decide, after havinganalyzed the whole segment or a substantial part of it, to vary thelength of the GOP within the segment in such a way as to optimize thecompression and quality. For example, if the analysis of the entire (orpart of the) segment reveals the presence of a static scene, the encodercan decide to adopt a very long GOP (for example 5, 10 or more timeslonger than a real-time encoder would have selected) and thus obtain ahigh level of compression that could not be achieved by a real-timecompression, since the latter is not capable of analyzing many frames inthe future.

According to a further illustrative option, the off-line encoding cancomprise processing a segment several times in order, for example, todetect, remove and/or correct any imperfections. The repeated processingcan also comprise applying, in each iteration, various compressionparameters in order to select the best encoding at the end of a certainnumber of iterations.

In the example in which the input signal is grouped, the segmentconsists of a finite number of groups of the input signal. As alreadyexplained above, in fact, in such a case the preset duration will beequal to a predetermined time and a variance Δ to make sure that thesegment is closed not at a predefined timer but rather at the last frameof the GOP of the input signal. Also conceivable is a case in which itis actually desired to limit the preset duration to a predetermined time(i.e. with delta equal to zero), for example one minute, notwithstandingthe grouping of the input signal. In such a case, it will be necessaryto decode the input signal so as to obtain an intermediate signalunlinked from the constraints of the previous encoding; in this manner,it will be possible to divide or interrupt the intermediate signal withthe frame that falls exactly at the sixtieth second.

According to a further example, the continuous encoded signal isrecomposed together with at least an audio signal or a data signal. Theaudio and data signals may or may not be compressed. Therefore, themethod described above, for example with reference to FIG. 1, can beapplied not only to the encoding of a video signal but also to theencoding of a signal also comprising an audio signal and/or a datasignal.

In a further example, the continuous encoded signal associated with onechannel is recomposed together with the video signals (optionally alsowith audio and/or data signals) of other channels.

According to a further example, the video signal included in the linearstream, as described above, can undergo real-time encoding before beingacquired (S100) or after being acquired. For example, if the inputsignal is an SDI or HD-SDI signal, it is possible to carry out a firstreal-time compression to obtain a grouped signal according to a knownstandard (for example MPEG2, MPEG4 or H.264), that will then undergo thesubsequent steps S200, S300, S400 and S500 as illustrated in FIG. 1. Insuch a case, the real-time encoding can be set to process only a verylimited number of frames, for example a number between 10 and 15, so asto rapidly obtain a signal having a bandwidth of 10 Mb/s (for examplewith an average GOP length of 12 frames) and thus much more limited thanthat of, for example, an HD-SDI signal having a bandwidth, for example,of 1.5 Gb/s. In such a case, the segmentation can be performed on thesignal encoded in real time. Alternatively, the segmentation can beperformed prior to the real-time compression, i.e. directly on theHD-SDI signal. Each segment can thus undergo a first real-time segmentcompression, which will be followed by off-line encoding as per stepsS300 and S400, thus making it possible to reach a high level ofcompression without impairing quality, while maintaining a preset,configurable latency.

In one illustrative example, the first encoding can be carried out by afirst encoder, and the second encoding by a second encoder, wherein boththe first and second encoders are part of an encoder structure dedicatedto the linear stream. Greater details will be provided below withreference to FIG. 2.

A second embodiment will be illustrated below with reference to FIG. 2,which shows an entity for real-time encoding of a signal comprising atleast a video signal. An entity can be implemented in a single device,via HW/SW or a combination thereof, or in multiple interconnected unitsor devices (similarly HW, SW or a combination thereof). All of theconsiderations already expressed with reference to the first embodimentwill also apply in general below (and thus with reference to otherembodiments or examples as well) and will therefore not be repeated.

The device 200 in FIG. 2 comprises acquiring means 210, dividing means220, first encoding means 230, second encoding means 240 and recomposingmeans 250.

The acquiring means 210 are configured to acquire the video signalincluded in the linear stream, the linear stream comprising at least twocontents without a logical distinction between them. The IN signalprovided to the acquiring means is an example of the above-mentionedinput signal, which can be in a grouped format (for example, accordingto standards such as MPEG2, MPEG4, AVC, H.264, etc. . . . ) or ungroupedformat, because provided, for example, in HD-SDI, SDI format, etc. . . ., or in any digital format (because thus available from the source orafter conversion from an analog signal).

The dividing means 220 divide the acquired signal into at least a firstsegment and a second segment of respective preset durations (aspreviously said, not necessarily identical), wherein at least one of thetwo segments is capable of containing at least a part of the twocontents (in fact, it is important for at least one segment to have thisproperty, in the event that it is possible to establish that the othersegment will certainly contain only one content). The segments furthercomprise recomposing information, as mentioned above or as furtherdetailed below.

The first encoding means 230 are configured to execute a first encodingof the first segment (221) using an off-line encoding, thus obtaining afirst encoded signal 232. The second encoding means 240 are insteadconfigured to execute a second encoding of the second segment (222)using an off-line encoding to obtain a second encoded segment 242. Inthe figure the output signals 221 and 222 are illustrated as beingoutput from two distinct ports; the means 220 can be configured,however, to be emitted from the same port. The same applies for theinputs to the means 250. The second encoding is carried out at leastpartially in parallel with the first modification, for the reasonsillustrated above, though it is conceivable that one of the two encoders230, 240 may be omitted so that the encoding of the two segments takesplace sequentially, provided that the remaining encoder has sufficientresources to ensure that the encoding is completed with the last frameor immediately after receipt of the last frame (in the event, forexample, that the last portion of the frame is not compressed orcompressed with a much lower compression factor to ensure completion ofthe compression at or nearly at the end of the segment).

Finally, using the recomposing information, the recomposing means 250recompose the first encoded segment 232 and the second encoded segment242 to obtain a continuous encoded OUT signal. The signal thus obtainedcan thus be broadcast, possibly after undergoing further processing.

It should be noted that FIG. 2 is a schematic representation. Theacquiring means 210, dividing means 220, first and second encoding means220 and 230 and recomposing means 250 (noting that they can also beidentified as acquirer 210, divider 220, first and second encoder 230,240 and recomposer 250, respectively) can be realized in the form ofhardware, software or a suitable combination of the two. For example,the encoders 230 and 240 can be obtained through two separate hardwarestructures, or by means of a logical partition of a same hardwarestructure. It is moreover conceivable to combine various separateencoders with one or more higher performance encoders to be partitionedin a logical manner; this could prove useful in the presence, forexample, of a large number of segments to be processed in parallel.Furthermore, use could be made of an encoder with a grid structure,capable of dividing the encoding work (schematically represented by theblocks 230 and 240) among a number of machines and processorssimultaneously.

With reference to FIG. 3, there will be illustrated a third embodimentrelating to a method for treating a signal to be processed withnear-real-time encoding, wherein the signal comprises at least a videosignal. In a step S310, the video signal included in a linear stream isacquired, the linear stream comprising at least two contents without alogical distinction between them. This signal can be represented by thepreviously described input signal, for example one in a non-compressedformat, in an SDI or HD-SDI format or in a format compressed accordingto a MPEG2, MPEG4, AVC, H.264 format, etc. . . . . In a subsequent stepS320, the video signal is divided into at least a first segment and asecond segment of preset duration, wherein each of the two segments iscapable of containing at least a part of the two contents without alogical distinction. Each of the segments further comprises recomposinginformation. As mentioned above, the preset duration corresponds to thecombination of a predetermined time and a pre-established variance,wherein the pre-established variance can take on a value of 0 in aspecific case. If the pre-established variance takes on a value equal to0, each segment will have a constant duration equal to the predeterminedtime until the predetermined time is manually or automatically changedas illustrated above. For example, if the predetermined time is equal toone minute and the pre-established variance is equal to 0, each segmentwill have exactly the length of one minute as long as none of thosevalues is modified manually and/or automatically. If the input signal isgrouped, it cannot be ruled out that the GOPs of the input signal may becharacterized by a slightly variable length.

In order to obtain a segment that includes a whole number of GOPs, itwill therefore be advisable to define the preset duration by adding orsubtracting a pre-established variance to the predetermined time. Let usconsider, for example, a predetermined time equal to 60 s and apre-established variance equal to twelve frames, a value chosen becauseit coincides in the example with the average length of the GOP of theinput signal. The end of a segment can thus be conveniently determinedas corresponding with the end of the last frame of the GOP included inthe interval (60 s−12; 60 s+12 frames). Reference is also made to thediscussion set forth above, which, as said, also applies to this andother embodiments as well as examples. The recomposing information issuch as to enable the reconstruction of the output segments, onceencoded, so as to follow the same sequence as prior to segmentation. Forexample, the recomposing information is represented by a sequentialnumber or by a unique identifier of each segment within each linearstream or channel, as illustrated above. The recomposing information isnecessary since it cannot be ruled out that the encoding of a secondsegment, following the first one in time, may be completed before theencoding of the first segment. Let us think, for example, of a case inwhich the second segment refers to the closing credits of a film and thefirst segment to the last action scene of the same film: it cannot beruled out that the encoding of the closing credits may be completedbefore the last action scene is encoded, in particular in the event thatthe frames need to be re-processed a number of times in the encoding ofthe action scene or in the event that errors are detected and need to becorrected in a further step. The recomposing information thereforeserves to remedy an incorrect reconstruction of the encoded signal.

According to an optional step not illustrated in FIG. 3, the method cancomprise a step of recomposing, using the recomposing information, afirst encoded segment and a second encoded segment obtained by encodingthe two segments resulting from step S320.

FIG. 4 illustrates a further embodiment relating to a device fortreating a signal to be processed with near-real-time encoding andcomprising acquiring means 410 and dividing means 420. The acquiringmeans 410 are capable of acquiring the video signal included in a linearstream, the linear stream comprising at least two contents without alogical distinction between them. The dividing means 420 are configuredto divide the video signal into at least a first segment and a secondsegment of preset duration, wherein each is capable of containing atleast a part of one of the two contents without a logical distinctionbetween them. Moreover, each of the segments comprises recomposinginformation. Thanks to this feature, it is possible to break down acontinuous flow into segments of preset duration that are easy toprocess, for example (not by way of limitation) easy to subject to anoff-line encoding transparent to the off-line encoder. The flow thussegmented can be more easily subjected to other operations that arenormally not (directly) applicable to linear streams.

FIG. 5 illustrates an explanatory example in which an IN linear streamhaving a bandwidth B1 is processed according to the method illustratedin FIG. 1 or one of the variants thereof. In the example of FIG. 5, itis assumed that the IN signal is in HD-SDI format having a bandwidth of1.5 Gb/s or is grouped into GOPs having an average length of 12 framesand bandwidth of 10 Mb/s obtained, for example, via the standard H.264.The IN stream is thus segmented into the segments S1, S2, S3 (and soforth according to need), each having a length of two minutes in theexample (noting that the length could differ by a few milliseconds inorder to include a whole number of GOPs (Ng) in the event that the INsignal is in group format. Assuming that there are only two encoders,the first segment S1 will be processed in an interval T1 and the secondsegment S2 in a corresponding interval T2.

The interval T2 will begin as early as possible at the moment when thesegment S2 is available. At the end of each encoding, that is, at theend of the intervals T1 and T2, respectively, the compressed segmentsS′1 and S′2 are output in a sequence corresponding to the input segmentsS1 and S2 thanks to the recomposing information. In this manner, thesequence of the output frames corresponds to the sequence of the inputframes. Although the intervals T1 and T2 are portrayed as having thesame length, their encoding time can vary in practice, evensubstantially, as illustrated above in the example of the closingcredits and action scene.

The off-line encoding applied, respectively, at times T1 and T2 must besuch as to ensure completion of the compression of the entire segmentbefore it has to be output. In the illustrated example, there will becorresponding margins M1 and M2 indicating that each of the encoders hascompleted the respective operations a certain amount of time in advancerelative to the moment when the segment must be output (the two segmentsmust be output respectively at 3:00 and 5:00 minutes). This means thatby sizing, for example, the encoder relative to a typical case, it willbe possible to provide for a safety time M1 or M2 to processparticularly complex segments (for example, ones rich in details orscene changes) or to correct unexpected errors.

FIG. 5 illustrates the example in which two segments are processed inparallel. However, the person skilled in the art will immediatelyrecognize the same parallelization can be applied in the case of anumber N (as large as desired) of segments to be processed in parallel.In such a case, there will be N distinct processes rather than two,carried out by an encoder with a grid architecture, by N distinctencoders or by any suitably configured HW/SW combination. As mentionedabove, it is also conceivable to dispense with parallelization in theevent that a particularly powerful encoder is available, for example onecapable of performing an excellent compression on most of the segment(excluding, for example, the last part of the segment, for example thelast 20 frames or the last or some of the last GOPs), in such a way asto complete the process at the moment when the last GOP of therespective segment is received (or a few instants after the last framehas been received, for example the equivalent of 10-50 frames from theend of the segment). As said, the values in FIG. 5 are purely examples.In another example, one could choose a 32 sec segment with a time of 4min left to off-line encoding. The latency remains constant (at thelimit in the interval established by the tolerance or variance asdescribed above) because, in the 4 minutes necessary for encoding thefirst segment, the encoding of the subsequent segments is started (inparallel) and thus the first segment is ready at 4:00, the second at4:32, the third at 5:04 and so forth.

According to another embodiment, the present invention further comprisesa program for a computer configured to carry out, when the program isrun on a computer, one or more of the steps according to the methoddescribed above or one of the variants thereof. The computer on whichthis program can be run is to be understood as any system capable ofprocessing signals and processing instructions, made up of one orseveral interconnected units, capable of executing instructions that areprogrammed or configured for the execution of the above-described steps.

The instructions of the program for a computer can moreover be stored ina suitable medium, such as, for example, a static memory, a hard disk orany other medium such as a CD, DVD or Blue Ray, or they can betransmitted via a carrier signal for execution on a remote entity.

As stated above, the recognitions of the inventors have led to a novelsolution for video encoding which exploits the mechanisms of off-linecompression, but exploits them within a time such as to ensure a maximumdelay in the order of a few minutes (in the example in FIG. 5). Thisvideo encoding mode is defined as near live or near real-time. The stepsof the near real-time video encoding process are the following, in thisfurther illustrative example:

-   -   acquisition of the input audio/video/subtitles signal, live        compression of the audio/video signal in a high quality format        with a high bit rate and simultaneous extraction and saving of        subtitles; for example, the process of acquiring the HD-SDI        signal is carried out by means of a specific acquisition board        installed in a server. The 1.5 Gbit/s signal cannot be written        at this bit rate on the commonly used media, so there is a first        encoding carried out at 50 Mbit/s in CBR with GOP at 4 seconds        (this is not a binding choice). The GOP is set as “closed” in        such a way as to enable the continuous stream to be divided into        a number of segments of preset duration. Also acquired at this        stage (in this example) are the subtitles within the VANC of the        SDI which are extracted in binary form and segmented in such a        way as to be synchronous with the audio/video stream so that for        every audio/video segment there is a corresponding subtitle        segment.    -   division of the continuous audio/video stream (without logical        distinction between one content item and another) into segments        (consisting of n-GOPs or groups of pictures) of preset duration        by the operator, with the extraction of in/out information (i.e.        information that enables the segments to be re-aggregated);    -   subdivision and encoding of the audio/video segments in a        mutually independent manner (i.e. each segment is processed in        parallel and, potentially exploiting a larger number of        encoders, a number of segments can be processed simultaneously        in several encoders); in this step the segmented stream (in        segments with a duration of two minutes in one example) can be        encoded by a VOD encoder. For this reason it may be convenient        to use a VOD encoder with grid architecture, capable of dividing        the encoding work among a number of machines and processors        simultaneously, further ensuring the possibility of reworking        any segments that should provoke errors.    -   multiplexing of the encoded audio/video segments (n-GOPs) with        the respective subtitles, maintaining the temporal synchronism        (i.e. re-aggregation of the segments using the in/out        information extracted in the step of dividing the continuous        audio/video stream).

In fact, once the encoding of the various segments has been completed,the audio, video and subtitle streams must be “put together”(multiplexed) in such a way as to have a single stream (transportstream) composed of video, audio and subtitles. Having the differentelementary streams at its disposal, the muxer (for example a customcomponent developed on commercial libraries produced, for example, by“Manzanita”) puts them together, abiding by the standards called DVB-S2,in such a way as to form a single transport stream with the singlecomponents together.

-   -   continuous playout of the multiplexed segments, in the encoder        output format: the last optional stage in the chain in the        present example is playout. The aim of this component is to send        the transport stream continuously toward the multiplexer of the        satellite transmission chain. The output is delivered in a        format complying with ASI specifications, on an SDI or IP        channel. The playout is synchronized with the acquisition        process and applies a constant delay in the reproduction of        frames, in the order of minutes relative to the time of        acquisition.

As mentioned above, thanks to the recognition of the inventors a resultis obtained which ensures a high quality, maintains the processesunchanged, and has a bandwidth efficiency that is 30-40% higher than theone used today, which means an equivalent benefit in terms oftransmission bandwidth.

The overall architecture of the encoder lends itself to beingdistributed over several physical servers. For example, in aconfiguration made up of two servers, one will host the acquisition andplayout processes and the other will host the encoding grid.

In particular the recognition of the inventors enables an efficientsolution of off-line compression applied to linear distribution, sinceit divides the continuous audio/video signal into segments of a durationthat is preset by the operator (and can range from a few seconds to afew minutes, based on the power and number of the encoders that mustprocess the segments in parallel) and is able to start a continuousstream for off-line compression (created to manage individual contentsthat are separate from one another), obtaining as output a continuouscompressed stream with the quality typical of off-line compression butmanaged with a delay of just a few minutes (in the example in FIG. 5).And thus with the near real-time compression process the compressionquality is improved compared to the real-time compression adopted up tonow for satellite broadcasting (because the potentialities of off-linecompression are exploited) and yet a process is created which (thanks tothe creation of segments that can be re-aggregated and are set on thepossibility of parallel management by the available encoders) can alsobe adapted to linear distribution. It should be noted that a method formanaging a continuous audio/video stream with off-line compression andwith a delay of just a few minutes serves to improve distribution insatellite broadcasting (off-line compression is up to 40% more efficientthan real-time compression).

This solution can moreover be applied to a significant percentage of thecontents distributed by an operator: in fact, up to 60% (or more) of thecontents normally distributed can be processed through thesegmentation-compression in parallel—re-aggregation sequence, in such amanner as not to determine any interruption in the linear distributionstream, thus making it possible to achieve considerable bandwidthsavings (even 40% or more) that are not imaginable with the presentlinear channel encoding systems.

In addition to what has already been disclosed and for furtherillustrative purposes, we shall also note other features of an off-linecompression process.

For example:

(A) in off-line compression individual contents are processed ratherthan continuous streams of contents (i.e. contents having a beginningand an end, like a film, an advertisement, a promo, etc. are processed)and thus the product of the compression, even when placed in sequence,does not lose this individuality. Contents that are compressed off-line,where joined together in sequence, do not have an end which perfectlyfits with the start of the subsequent content and to ensure the splicebetween contents it is necessary to insert “black” elements.(B) off-line compression is particularly efficient (the quality of theoutput being equal, it can compress 40% more content than real-timecompression) but requires a long and accurate process, because theentire content is processed more than once and, if there are anyimperfections in the compression process, they are detected and removed.This accurate process requires 2-3 times the duration of an individualcontent (that is, if we need to compress off-line a film that lasts 2hours, it can take us up to 6 hours).

The following should also be noted with regard to the creation ofsegments according to what has been recognized by the inventors.Off-line compression is generally applied to complete contents (a film,an advertisement, etc.) and thus has operating times that are notcompatible with linear distribution (it would in fact entail a delay ofseveral hours). Contents processed off-line cannot be placed in sequencewithout inserting “black” elements, because the end of one content doesnot fit perfectly with the beginning of the subsequent content. Thevideo encoding solution envisages dividing the continuous audio/videostream into segments of a given duration. It should be noted that thesegments do not necessarily coincide with a content or with a portion ofcontent (i.e. in a segment the end of one content and the beginning ofanother content could coexist, without solution of continuity). Togetherwith the segments, in/out information is extracted from the continuousaudio/video stream; this enables the continuous audio/video stream to berecomposed after the off-line compression process exactly as it wasprior to the compression. The segment duration is predetermined by theoperator (and can range from a few seconds to several minutes). Saidduration can be calibrated based on the power and number of theavailable encoders and based on the number of segments that must beprocessed in parallel. Calculating the duration of the segments enablesthe off-line compression process to proceed fluidly (i.e. the segmentsdo not last longer than it takes the encoders to process them inparallel, so that no “bottleneck” is created between what comes in andwhat goes out of the encoder). The segments can have a duration such asto enable an off-line compression with a delay limited to just a fewminutes.

Many of the embodiments and examples have been illustrated withreference to steps of methods or processes.

However, what has been described can also be implemented in a program tobe run on a computing entity (also a distributed one) or on an entitywith appropriately configured means. As illustrated above, the entitycan be implemented in a single device, via HW/SW or a combinationthereof, or in multiple interconnected units or devices (likewise HW, SWor a combination thereof).

Naturally, the description set forth above of embodiments and examplesapplying the principles recognized by the inventors is given solely forthe purpose of exemplifying such principles and must therefore not beconstrued as a limitation of the scope of the patent rights claimedhere.

The invention claimed is:
 1. A method for near-real time encoding of asignal comprising at least a video signal, the method comprising thesteps of: acquiring said video signal included in a linear stream, saidlinear stream comprising at least two contents without a logicaldistinction between them; dividing the video signal into at least afirst segment and a second segment of respective preset durations, atleast one of said segments being capable of containing at least a partof said two contents, and each of said at least first and secondsegments include recomposing information enabling reconstruction of afirst encoded segment and a second encoded segment to follow a sequencethat is the same as the first segment and the second segment; executinga first encoding of said first segment using an off-line encoding toobtain the first encoded segment; executing a second encoding of saidsecond segment using an off-line encoding to obtain the second encodedsegment, said second encoding being executed at least partially inparallel with the first encoding; recomposing, using said recomposinginformation, said first encoded segment and said second encoded segmentto obtain a continuous encoded signal, wherein the latency introduced bythe near-real time encoding is configurable and nearly constant.
 2. Themethod according to claim 1, wherein the off-line encoding is such thatencoding of a respective segment is completed in a time which is shorterthan or equal to a pre-configured delay.
 3. The method according claim1, wherein each of said preset durations is comprised in an intervaldetermined by a combination of a predetermined time and apre-established variance.
 4. The method according claim 1, wherein saidfirst segment and second segment are distinct from groups of framesobtained through a video encoding algorithm.
 5. The method accordingclaim 1, wherein the off-line encoding comprises at least one stepbetween: varying a length of a group of frames inside one segment;processing a segment several times, and wherein the processing comprisesat least one step among detecting, removing and correcting possibledefects.
 6. The method according claim 1, wherein, where an incomingsignal is grouped, a segment is composed of a finite number of groups ofthe incoming signal.
 7. An apparatus for near-real time encoding of asignal comprising at least a video signal comprising: acquiring meansconfigured to acquire said video signal included in a linear stream,said linear stream comprising at least two contents without a logicaldistinction between them; dividing means configured to divide the videosignal into at least a first segment and a second segment of presetduration, at least one of said segments being capable of containing atleast a part of said two contents, and each of said at least first andsecond segments include recomposing information enabling reconstructionof a first encoded segment and a second encoded segment to follow asequence that is the same as the first segment and the second segment;first encoding means configured to execute a first encoding of saidfirst segment using an off-line encoding to obtain the first encodedsegment; second encoding means configured to execute a second encodingof said second segment using an offline encoding to obtain the secondencoded segment, said second encoding being executed at least partiallyin parallel with the first encoding; recomposing means configured torecompose, using said recomposing information, said first encodedsegment and said second encoded segment to obtain a continuous encodedsignal; wherein the latency introduced by the near-real time encoding isconfigurable and nearly constant.
 8. A method for treating a signal tobe processed with near-real time encoding, said signal comprising atleast a video signal, said method comprising the steps of: acquiringsaid video signal included in a linear stream, said linear streamcomprising at least two contents without a logical distinction betweenthem; dividing the video signal into at least a first segment and asecond segment each having respective preset durations, at least one ofsaid segments being capable of containing at least a part of said twocontents without a logical distinction, and each of said at least firstand second segments include recomposing information enablingreconstruction of a first encoded segment and a second encoded segmentto follow a sequence that is the same as the first segment and thesecond segment.
 9. The method according to claim 8, wherein said videosignal included in said linear stream is processed with a real-timeencoding before being acquired to obtain a grouped video signal, andwherein each respective said preset duration is comprised in an intervaldetermined by a combination of a predetermined time and apre-established variance.
 10. The method for treating a signal accordingto claim 9, further comprising the step of recomposing, using saidrecomposing information, a first encoded segment and a second encodedsegment to obtain a continuous encoded signal, said first and secondencoded segments obtained from said first segment and second segmentthrough an off-line encoding algorithm.
 11. A non-transitorycomputer-readable medium for near-real time encoding of a signalcomprising at least a video signal, the non-transitory computer-readablemedium having computer-readable instructions stored thereon which, whenexecuted by a computer system, cause the computer system to perform thesteps of: acquiring said video signal included in a linear stream, saidlinear stream comprising at least two contents without a logicaldistinction between them; dividing the video signal into at least afirst segment and a second segment of respective preset durations, atleast one of said segments being capable of containing at least a partof said two contents, and each of said at least first and secondsegments include recomposing information enabling reconstruction of afirst encoded segment and a second encoded segment to follow a sequencethat is the same as the first segment and the second segment; executinga first encoding of said first segment using an off-line encoding toobtain the first encoded segment; executing a second encoding of saidsecond segment using an off-line encoding to obtain the second encodedsegment, said second encoding being executed at least partially inparallel with the first encoding; recomposing, using said recomposinginformation, said first encoded segment and said second encoded segmentto obtain a continuous encoded signal, wherein the latency introduced bythe near-real time encoding is configurable and nearly constant.